﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfPdfReader
{
    /// <summary>
    /// WindowAddBookmark.xaml 的交互逻辑
    /// </summary>
    public partial class WindowAddBookmark : Window
    {
        public WindowAddBookmark()
        {
            InitializeComponent();
            this.bookMarkName.Focus();
        }

        private void btnOk_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }

        private void btnCancel_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

        public string BookMarkName
        {
            get
            {
                return this.bookMarkName.Text.Trim();
            }
        }

        public string Note
        {
            get { return this.note.Text.Trim(); }
        }

        private void bookMarkName_TextChanged(object sender, TextChangedEventArgs e)
        {
            this.btnOk.IsEnabled =!string.IsNullOrEmpty( this.bookMarkName.Text.Trim());
        }
    }
}
